import request from '@/utils/request.js'

// 分页查询接口
export const pageList = (data) =>
    request.get('/user/role/', {
        params: {
            "page": data.page,
            "size": data.size,
            "status": data.status,
            "roleName": data.roleName,
        }
    })


// 删除
export const deleteByIds = (ids) =>
    request.delete('/user/role/deleteRoleByIds/', {data:ids})

// 获取菜单树结构
export const menuTreeselect = () =>
    request.get('/user/menu/treeselectMenu/')


// 新增角色
export const saveRoleMenu = (data) =>
    request.post('/user/roleMenu/saveRoleMenu/',data)

// 修改角色回显
export const selectRoleById = (id) =>
    request.get(`/user/role/selectRoleById/${id}`)

// 修改角色
export const updateRole = (data) =>
    request.put('/user/role/updateRole/',data)


// 修改状态
export const changeStatusById = (data) =>
    request.put('/user/role/changeStatusById/',data)